package userInterfaces;

import java.io.IOException;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;


@ManagedBean
@RequestScoped
public class LogoutManagedBean {
	
	public void logout() {
		FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
		ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
		externalContext.invalidateSession();
		try {
			externalContext.redirect(externalContext.getRequestContextPath() + "/home.xhtml");
		} catch (IOException e) {

			e.printStackTrace();
		}
	}


}
